# 元组是不可变的

my_tuple = (1, 2, 3, 'hello', True)
print(my_tuple)

# 空元组
my_tuple = ()
print(my_tuple)

my_tuple = tuple()
# <class 'tuple'>
print(type(my_tuple))
print(not my_tuple)

# 单个元素的元组
my_tuple = ('hello',)
print(type(my_tuple))

# 嵌套元组
my_tuple = ((1, 2, 3), 'hello', (2, 3, 4))
print(my_tuple[2][1])
# for i in my_tuple:
#     print(i)

print("==========")
# 元素下标
print(my_tuple[0].index(2))

my_tuple = (1, 2, 3, 'hello', 3)
print(my_tuple.count(3))
print(len(my_tuple))

# for i in my_tuple:
#     print(i)

print("==========")
# 里面的list数据是可以修改的
my_tuple = (1, 2, ['python', 'test'])
my_tuple[2].pop()
print(my_tuple)

